package com.hehua.Adapter;

/**
 * 警车适配器
 * 充当适配器
 */
public class PoliceCarAdapter extends CarController {
    /**
     * 定义适配者PoliceSound对象
     */
    private PoliceSound policeSound;
    /**
     * 定义适配者PoliceLamp对象
     */
    private PoliceLamp policeLamp;

    public PoliceCarAdapter(){
        policeSound = new PoliceSound();
        policeLamp = new PoliceLamp();
    }

    /**
     * 发出警笛声音
     */
    @Override
    public void phonate() {
        policeSound.alarmSound();
    }

    /**
     * 发出灯光
     */
    @Override
    public void twinkle() {
        policeLamp.alarmLamp();
    }
}
